﻿#region Copyright 
/*-------------------------------------------------------------------------
* 命名空间名称/文件名:    SSPivot.Admin.Core.DbModel.sys/sys_user 
* CLR版本:     4.0.30319.42000
* 机器名称:    DESKTOP-NHMLO8A
* 功 能：       N/A
* 类 名：       sys_user
* 创建时间：  2025/6/4 10:44:08
* 版本号：      v1.0
* 创建人:        xulong
*-------------------------------------------------------------------------*/
#endregion
using SSPivot.AspNetCore.Abstractions.User;
using SSPivot.Data.Entities;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SSPivot.Admin.Core.DbModel.sys
{
    /// <summary>
    /// 用户
    /// </summary>
    public class sys_user : FullAuditedEntity<long>
    {
        public long? TenantId { get; set; }

        /// <summary>
        /// 账号
        /// </summary>
        [StringLength(60)]
        public string? Account { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [StringLength(200)]
        public string? Password { get; set; }

        /// <summary>
        /// 姓名
        /// </summary>
        [StringLength(60)]
        public string? Name { get; set; }

        /// <summary>
        /// 手机号
        /// </summary>
        [StringLength(20)]
        public string? Mobile { get; set; }

        /// <summary>
        /// 邮箱
        /// </summary>
        [StringLength(100)]
        public string? Email { get; set; }

        /// <summary>
        /// 主属部门Id
        /// </summary>
        public long OrgId { get; set; }


        /// <summary>
        /// 直属主管Id
        /// </summary>
        public long? ManagerUserId { get; set; }


        /// <summary>
        /// 昵称
        /// </summary>
        [StringLength(60)]
        public string? NickName { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        [StringLength(500)]
        public string? Avatar { get; set; }

        /// <summary>
        /// 用户状态
        /// </summary>

        public UserStatus? Status { get; set; }

        /// <summary>
        /// 用户类型
        /// </summary>

        public UserType Type { get; set; } = UserType.DefaultUser;

        /// <summary>
        /// 最后登录时间
        /// </summary>
        [StringLength(100)]
        public DateTime? LastLoginTime { get; set; }

        /// <summary>
        /// 最后登录IP
        /// </summary>
        [StringLength(100)]
        public string? LastLoginIP { get; set; }

        /// <summary>
        /// 最后登录国家
        /// </summary>
        [StringLength(100)]
        public string? LastLoginCountry { get; set; }

        /// <summary>
        /// 最后登录省份
        /// </summary>
        [StringLength(100)]
        public string? LastLoginProvince { get; set; }

        /// <summary>
        /// 最后登录城市
        /// </summary>
        [StringLength(100)]
        public string? LastLoginCity { get; set; }

        /// <summary>
        /// 启用
        /// </summary>
        public bool Enabled { get; set; } = true;

    }
}

